﻿<Button x:Class="GraduApplication.Controls.SwipeButton"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" d:DesignWidth="464" d:DesignHeight="79" >
    <Button.Template>
        <ControlTemplate TargetType="Button">
            <Grid Background="{x:Null}">
                <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="CommonStates">
                    	<VisualStateGroup.Transitions>
                    		<VisualTransition From="MouseOver" GeneratedDuration="0">
                    			<Storyboard>
                    				<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="rectangle">
                    					<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                    					<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0"/>
                    				</DoubleAnimationUsingKeyFrames>
                    			</Storyboard>
                    		</VisualTransition>

                    	</VisualStateGroup.Transitions>
                		<VisualState x:Name="Normal"/>
                		<VisualState x:Name="MouseOver">
                			<Storyboard >
                						<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="rectangle">
                    					<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                    					<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
                    				</DoubleAnimationUsingKeyFrames>
                			</Storyboard>
                		</VisualState>
                		<VisualState x:Name="Pressed"/>
                		<VisualState x:Name="Disabled"/>
                	</VisualStateGroup>
                    <VisualStateGroup x:Name="FocusStates">
                        <VisualState x:Name="Unfocused"/>
                        <VisualState x:Name="Focused"/>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>
                <Rectangle x:Name="rectangle" RadiusX="40" RadiusY="40" Visibility="Visible" RenderTransformOrigin="0.5,0.5">
                    <Rectangle.Fill>
                        <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                            <GradientStop Color="#FF08FF00" Offset="1"/>
                            <GradientStop Color="Red"/>
                            <GradientStop Color="#FF197600" Offset="0.551"/>
                            <GradientStop Color="#FF6E0000" Offset="0.474"/>
                        </LinearGradientBrush>
                    </Rectangle.Fill>
                    <Rectangle.RenderTransform>
                    	<TransformGroup>
                    		<ScaleTransform ScaleX="0"/>
                    		<SkewTransform/>
                    		<RotateTransform/>
                    		<TranslateTransform/>
                    	</TransformGroup>
                    </Rectangle.RenderTransform>
                </Rectangle>
                <Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="4" CornerRadius="0" Width="75" Background="Black" >
                    <ContentPresenter
                		x:Name="contentPresenter"
                		Content="{TemplateBinding Content}"
                		ContentTemplate="{TemplateBinding ContentTemplate}"
                		VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                		HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
                </Border>
            </Grid>
        </ControlTemplate>
    </Button.Template>

</Button>